package com.example.zxslzw2014_8_11;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

@Component
public class BeanConfig {

    @Bean("u1")
    public UserInfo userInfo() {
        UserInfo user = new UserInfo();
        user.setId(6);
        user.setName("shenmengyao");
        user.setAge(18);
        return user;
    }
    @Bean
    public UserInfo userInfo1() {
        UserInfo user = new UserInfo();
        user.setId(7);
        user.setName("yuanyiqi");
        user.setAge(19);
        return user;
    }
}
